home *** CD-ROM | disk | FTP | other *** search
- Path: paperboy.wellfleet.com!newsmaster
- From: psmith@lemming.wellfleet.com (Paul D. Smith)
- Newsgroups: comp.unix.programmer,comp.lang.c
- Subject: Re: Runtime ANSI C checking tool?
- Date: 28 Feb 1996 19:14:53 -0500
- Organization: Bay Networks, Inc., Billerica, MA
- Message-ID: <p5ag239ede.fsf@lemming.wellfleet.com>
- References: <DnI89B.EnH@pgh.nauticom.net>
- Reply-To: psmith@wellfleet.com
- NNTP-Posting-Host: lemming.wellfleet.com
- In-reply-to: tybergm@pgh.nauticom.net's message of Wed, 28 Feb 1996 21:12:47
- GMT
- To: tybergm@pgh.nauticom.net (Mark E. Tyberg)
- X-Newsreader: Gnus v5.1
-
- %% Regarding Runtime ANSI C checking tool?;
- %% tybergm@pgh.nauticom.net (Mark E. Tyberg) writes:
-
- met> Does anyone know of a program (for UNIX) that can do _runtime_
- met> checking for ANSI C violations/undefined behavior?
-
- Well, a well-written ANSI C compiler should handle all language
- violations, and a well-written ANSI C system library should catch all
- runtime violations (passing NULL to strcpy() or something, for
- example).
-
- Some vendors try to be cute and allow you to pass invalid args to
- standard functions without complaint by catching them and ignoring them
- (SunOS in particular does this a lot--not that SunOS's libc is ANSI by
- any stretch of the imagination :), but I say they should catch them and
- call abort() immediately! They're not doing you any favors by making it
- that much more difficult to find your bug. Dump core up front! Make it
- easy to find the problem!
-
- Unfortunately I'm not aware of a good ANSI C library that does all this:
- does GNU's libc do it? That might be an option, for testing purposes.
-
- Or did you have something else in mind?
- --
- -------------------------------------------------------------------------------
- Paul D. Smith <psmith@baynetworks.com> Network Management Development
- Senior Software Engineer Bay Networks, Inc.
- -----------------------------------------------==<http://www.baynetworks.com/>-
- "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
- -------------------------------------------------------------------------------
- These are my opinions--Bay Networks takes no responsibility for them.
-